package main

import (
	"fmt"
	"io"
	"net/http"
)

// 使用 DefaultServeMux
func main() {
	http.Handle("/demo", &resp1{})
	if err := http.ListenAndServe(":http", &resp2{}); err != nil {
		fmt.Println("Listen failed")
	}
}

type resp1 struct {
}

func (rp *resp1) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	io.WriteString(w, "=========== response1 =========")
}

type resp2 struct {
}

func (rp *resp2) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	io.WriteString(w, "=========== response2 =========")
}
